<?php
class WelcomeController extends Controller {
	function MainAction()
	{
        /* 获取最新记事本 */
        $notepad = OaModel::getInstance()->getNotepadList(ISession::get('uid'));

        /* 公告 */
        $this->data['bulletin_list'] = BulletinModel::getInstance()->getList();

        /* 日程 */
        $schedule = OaModel::getInstance()->getScheduleList(ISession::get('uid'));

       /* 提醒信息 */
        $msg = OaModel::getInstance()->getMyMsg($this->user['cid']);
        $this->data['msg'] = $msg;
        $this->data['schedule'] = $schedule;
        $this->data['notepad'] = $notepad;
		$this->view('welcome.main','index');
	}

    public function MsgViewAction()
    {
        $id = G('id');
        $info = OaModel::getInstance()->getMsgView($this->user['cid'], $id);
        if ($info['accept_flg'] == 0) {
            OaModel::getInstance()->editMsg(array('accept_flg'=>1), $id);
        }
        $this->data['info'] = $info;
        $this->view('msg.view','E');
    }
}